using Huioo.Learning.Csharp.ConcurrencyAndAsynchronous;
using System.Collections.ObjectModel;

namespace Huioo.Learning.Csharp.WinFormsApp1
{
    public partial class Form1 : Form
    {
        private readonly ObservableCollection<string> _usingNames = new ObservableCollection<string>(
            [
                "1",
                "2"
            ]);
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.comboBox1.DataSource = _usingNames;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            _usingNames.Add(typeof(TaskRunUsing).Name);
            var @using = new TaskRunUsing();
            @using.Run();
            this.richTextBox1.Lines = @using.LogMessages.ToArray();
        }
    }
}
